package main

import (
	"fmt"
	"main/scala/com/go/demo"
	"time"
)

func main() {
	fmt.Println("*******************************************************")

	fmt.Println("hello world!")

	fmt.Println("*******************************************************")

	result, err := demo.Sqrt(-1)
	if err != nil {
		fmt.Println(err)
	} else {
		fmt.Println(result)
	}

	result, err = demo.Sqrt(9)
	if err != nil {
		fmt.Println(err)
	} else {
		fmt.Println(result)
	}

	fmt.Println("*******************************************************")

	var circle = demo.Circle{X: 0, Y: 0, Radius: 5}
	rectangle := demo.Rectangle{Width: 10, Height: 5}
	fmt.Printf("Circle area: %f\n", demo.GetArea(circle))
	fmt.Printf("Rectangle area: %f\n", demo.GetArea(rectangle))

	fmt.Println("*******************************************************")

	a := "string"
	fmt.Println(a)

	const b = "test"
	fmt.Println(b)

	for i := 1; i <= 5; i++ {
		fmt.Println(i)
	}

	fmt.Println("*******************************************************")

	c := time.Now().Weekday()
	switch c {
	case time.Saturday, time.Sunday:
		fmt.Println("It's the weekend")
	default:
		fmt.Println("It's a weekday")
	}

}
